<?php
$message = array('id' => 'message', 'name' => 'message', 'value' => set_value('message'), 'size' => 500, 'maxlength' => 500);
$email_from = array('id' => 'from', 'name' => 'from', 'size' => 50);
$captcha = array('id' => 'captcha', 'name' => 'captcha', 'maxlength' => 8);
$submit = array('class' => 'btn btn-success', 'name' => 'submit', 'value' => 'Envoyer');

echo form_open($this->uri->uri_string().'/send');
?>

<div class="page-header">
    <h3>- Contactez un de nos charg&eacute;s de placement -</h3>
</div>

<p>
    <span class="form-inline">
        <?php
        echo
            'Votre email: '.form_input($email_from).
            form_error($email_from['name'], '<span class="alert">', '</span>');
        if(isset($errors[$email_from['name']]))
            echo '<span class="alert">'.$errors[$email_from['name']].'</span>';
        ?>
    </span>
    <span class="form-inline">
        <?php
        echo
            'Votre message: '.form_textarea($message).
            form_error($message['name'], '<span class="alert">', '</span>');
        if(isset($errors[$message['name']]))
            echo '<span class="alert">'.$errors[$message['name']].'</span>';
        ?>
    </span>
</p>

<?php
if($show_captcha) {
    if($use_recaptcha):
        ?>

    <div id="recaptcha" class="clearfix">
        <p id="recaptcha_image"></p>
        <p id="recaptcha_other">
            <a href="javascript:Recaptcha.reload()"><?php echo lang('auth_get_another_captcha'); ?></a><br />
            <a class="recaptcha_only_if_image" href="javascript:Recaptcha.switch_type('audio')"><?php echo lang('auth_get_audio_captcha'); ?></a>
            <a class="recaptcha_only_if_audio" href="javascript:Recaptcha.switch_type('image')"><?php echo lang('auth_get_image_captcha'); ?></a>
        </p>
    </div>

    <p>
        <span class="form-inline">
            <?php
            echo
                form_label(lang('auth_enter_words'), 'recaptcha_response_field', array('class' => 'recaptcha_only_if_image')).
                form_label(lang('auth_enter_numbers'), 'recaptcha_response_field', array('class' => 'recaptcha_only_if_audio')).
                form_input(array('id' => 'recaptcha_response_field', 'name' => 'recaptcha_response_field'));
            ?>
        </span>
        <?php
        echo
            form_error('recaptcha_response_field', '<span class="form-inline alert">', '</span>').
            $recaptcha_html;
        ?>
    </p>

    <?php
    else:
        ?>

    <p><?php echo lang('auth_enter_captcha_code'); ?></p>
    <p><?php echo $captcha_html; ?></p>
    <p>
        <span class="form-inline"><?php echo lang('auth_confirmation_code', $captcha['id']).form_input($captcha); ?></span>
        <span class="form-inline alert"><?php echo form_error($captcha['name'], '<span class="error">', '</span>'); ?></span>
    </p>

    <?php
    endif;
}
?>
<p class="form-actions"><?php echo form_submit($submit); ?></p>

<?php form_close(); ?>